package com.imut.lagain.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 性能监控配置属性
 */
@Component
@ConfigurationProperties(prefix = "performance.monitor")
public class PerformanceMonitorProperties {
    
    /**
     * 慢查询阈值（毫秒）
     */
    private long slowQueryThreshold = 1000;
    
    /**
     * 缓存慢操作阈值（毫秒）
     */
    private long cacheSlowThreshold = 500;
    
    /**
     * API慢响应阈值（毫秒）
     */
    private long apiSlowThreshold = 2000;
    
    /**
     * 是否启用性能监控
     */
    private boolean enabled = true;
    
    /**
     * 数据保留天数
     */
    private int dataRetentionDays = 30;
    
    /**
     * 采样率（0.0-1.0）
     */
    private double samplingRate = 1.0;
    
    public long getSlowQueryThreshold() {
        return slowQueryThreshold;
    }
    
    public void setSlowQueryThreshold(long slowQueryThreshold) {
        this.slowQueryThreshold = slowQueryThreshold;
    }
    
    public long getCacheSlowThreshold() {
        return cacheSlowThreshold;
    }
    
    public void setCacheSlowThreshold(long cacheSlowThreshold) {
        this.cacheSlowThreshold = cacheSlowThreshold;
    }
    
    public long getApiSlowThreshold() {
        return apiSlowThreshold;
    }
    
    public void setApiSlowThreshold(long apiSlowThreshold) {
        this.apiSlowThreshold = apiSlowThreshold;
    }
    
    public boolean isEnabled() {
        return enabled;
    }
    
    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }
    
    public int getDataRetentionDays() {
        return dataRetentionDays;
    }
    
    public void setDataRetentionDays(int dataRetentionDays) {
        this.dataRetentionDays = dataRetentionDays;
    }
    
    public double getSamplingRate() {
        return samplingRate;
    }
    
    public void setSamplingRate(double samplingRate) {
        this.samplingRate = samplingRate;
    }
}